package com.example.featuresdk.event

import android.util.Log

object ServiceMediator {

    const val TAG = "ServiceMediator"

    private val services = mutableMapOf<String,FeatureService>()

    fun register(path:String, service: FeatureService){

        Log.i(TAG,"register: $path = ${service.javaClass.canonicalName}")

        services[path] = service
    }

    suspend fun call(path: String, params: Map<String, Any>){
        Log.i(TAG,"")
        services[path]?.execute(params)
    }
}